SFPGetFile
SFPGetFile Initiate a customized Open.. dialog
#include <StandardFile.h> Standard File Package
void SFPGetFile(where, prompt, fileFilter, numTypes, typeList,
dlgHook, reply, dlogID, dlgEvtFilter );
Point where ; coordinates for topLeft of dialog window
Str255 prompt ; (unused; just specify NIL)
ProcPtr fileFilter ; filters filenames; NIL= standard filtering
short numTypes ; -1=all types; else=number of elements in typeList
SFTypeList typeList ; address of list of file types to include
ProcPtr dlgHook ; NIL= standard; else=address of custom routine
SFReply *reply ; address of structure; receives return info
short dlogID; resource ID of dialog box to use
ProcPtr dlgEvtFilter ; function for filtering events; NIL=none
SFPGetFile is the same as SFGetFile (the standard way to obtain a filename
for an "Open..." operation) except it provides for more advanced customization.
where is a screen location, expressed in global coordinates. The top-left
corner of the dialog window is positioned here.
prompt is ignored. Just pass a NIL (0) for this.
fileFilter is the address of a pascal-type function that will be called once for
each file matching the types in typeList . The filter function should
be declared as:
pascal Boolean myFileFilter( pbp )
fileParam *pbp;
numTypes is the number of elements in typeList . Use -1 to allow all files to
be listed.
typeList is the address of an array of OSType values (an SFTypeList is an
array of 4 such elements). This parameter specifies which file types
(e.g., 'TEXT', 'APPL', etc.) should be displayed. If numTypes is 0 or
-1, typeList is ignored.
dlgHook is the address of a custom procedure that handles the dialog. Use NIL
to specify the standard dialog. The dialog-handling function is
declared as:
pascal short myDlgProc( theItem, theDialog )
short theItem;
DialogPtr theDialog;
reply is the address of a variable-length SFReply structure. On entry, its
contents are ignored. Upon return, it contains the results of the
dialog, including the name of the file selected by the user.
dlogID is the resource ID of a dialog template ('DLOG') to be used. The
named constant getDlgID (-4000) can be used to bring up the
standard dialog template.
dlgEvtFilter is the address of a Pascal-type procedure that will be executed
directly after ModalDialog performs the standard event filtering.
Use NIL if you want just the normal filtering. See ModalDialog for
related details.
Returns: none

Notes: This works just like SFGetFile with the addition of the two parameters
dlogID and dlgEvtFilter .
Using SFPGetFile and specifying a custom dlogID is better than replacing
the standard resource, since it avoids problems associated with Desk
Accessories that rely on the standard dialog.
The dlgEvtFilter parameter identifies a function that provides additional
filtering or modification of dialog events; e.g., it could interpret
command-key keystrokes as editing actions, etc. This function should work
the same way as the filterProc described under ModalDialog.